#include <string>

auto f(std::string a) {
    std::string s;
    for (int i = 1; i < a.size(); ++i) {
        if (a[i] % 2 == a[i-1] % 2) {
            s += std::max(a[i], a[i-1]);
        }
    }
    return s;
}

#include <iostream>

int main() {
    std::string s1, s2;
    std::cin >> s1;
    std::cin >> s2;

    auto c1 = f(s1);
    auto c2 = f(s2);

    if (c1 == c2) {
        std::cout << c1;
    } else {
        std::cout << c1 << "\n" << c2;
    }
}
